
import actionType from "./actionType"
// interface listItem{
//     img:string,
//     title:string,
// }
const initState={
    list:[],
    tabType:'0'
}
// interface stateItem{
//     list:listItem[]
// }




const reducer =(state=initState,action:any)=>{
    const { type , payload} = action;
    switch (type) {
        case actionType.SET_LIST:
            return{
                ...state,
                list:payload
            }
        case actionType.CHANGE_TAB:
            // console.log(payload)
            return{
                ...state,
                tabType:payload,
            }
            
        default:
            return {...state}
    }

}

export default reducer